home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…stman Always Clicks Twice / ADC Developer CD (1993-01) (''The Postman Always Clicks Twice'')_iso / Dev.CD 199301.iso / Development Platforms / LISP Related / LISP Goodies / AV Parser / Sample Grammars / LFG-style Grammar < prev    next >
Encoding:
Text File  |  1992-09-02  |  8.0 KB  |  316 lines  |  [TEXT/CCL2]

  1. ;  this file contains a grammar written in a vanilla AV fashion,
  2. ;  vaguely inspired by LFG.  Grammatical relations are represented
  3. ;  by attributes.  No attempt is made to collapse ambiguous lexical
  4. ;  items.
  5.  
  6.  
  7. #[
  8. category-prefix = cat.  ; paths to category label
  9. value-prefix = head.
  10.  
  11. start-category := cat(**) = S1,
  12.                   root(*) = +,
  13.                   tensed(*) = +,
  14.                   slash(*) = none.
  15.  
  16. restrictor := cat(**) = _,
  17.               root(*) = _,
  18.               sem(slash(*)) = _,
  19.               inv(*) = _,
  20.               tensed(*) = _,
  21.               root(*) = _.
  22.  
  23. ;;;  Lexical items.
  24.  
  25. Mary NP: pred(sem(*)) = Mary,
  26.          num(agr(*)) = sg,
  27.          slash(*) = none.
  28.  
  29. people N: pred(sem(*)) = people,
  30.           num(agr(*)) = pl.
  31.  
  32. dog    N: pred(sem(*)) = dog,
  33.           num(agr(*)) = sg.
  34.  
  35. dogs   N: pred(sem(*)) = dog,
  36.           num(agr(*)) = pl.
  37.  
  38. cat    N: pred(sem(*)) = cat,
  39.           num(agr(*)) = sg.
  40.  
  41. cats   N: pred(sem(*)) = cat,
  42.           num(agr(*)) = pl.
  43.  
  44. sheep  N: pred(sem(*)) = sheep.
  45.  
  46. it    NP: sem(*) = it,
  47.           slash(*) = none.
  48.  
  49. the   Det: def(sem(*)) = +.
  50.  
  51. a     Det: def(sem(*)) = -,
  52.            num(agr(*)) = sg.
  53.  
  54. that   C:  wh(*) = -,
  55.            inv(*) = -,
  56.            tensed(*) = +.
  57.  
  58. who    C:  question(sem(*)) = +,
  59.            wh(*) = +,
  60.            slash(*) = none,
  61.            sem(binds(*)) = operator(sem(*)),
  62.            pred(sem(binds(*))) = who,
  63.            num(agr(binds(*))) = sg,
  64.            scope(sem(*)) = sem(scope(*)).
  65.  
  66. sleeps V: pred(sem(*)) = sleep,
  67.           sem(subj(*)) = agent(sem(*)),
  68.           num(agr(subj(*))) = sg,
  69.           obj(*) =none,
  70.           comp(*) = none,
  71.           tensed(*) = +,
  72.           inv(*) = -.
  73.  
  74. sleep  V: pred(sem(*)) = sleep,
  75.           sem(subj(*)) = agent(sem(*)),
  76.           num(agr(subj(*))) = pl,
  77.           obj(*) = none,
  78.           comp(*) = none,
  79.           tensed(*) = +,
  80.           inv(*) = -.
  81.  
  82. sleep  V: pred(sem(*)) = sleep,
  83.           sem(subj(*)) = agent(sem(*)),
  84.           obj(*) =none,
  85.           comp(*) = none,
  86.           tensed(*) = -,
  87.           form(*) = bare,
  88.           inv(*) = -.
  89.  
  90. chases V: pred(sem(*)) = chase,
  91.           agent(sem(*)) = sem(subj(*)),
  92.           patient(sem(*)) = sem(obj(*)),
  93.           num(agr(subj(*))) = sg,
  94.           comp(*) = none,
  95.           tensed(*) = +,
  96.           inv(*) = -.
  97.  
  98. chase  V: pred(sem(*)) = chase,
  99.           agent(sem(*)) = sem(subj(*)),
  100.           patient(sem(*)) = sem(obj(*)),
  101.           num(agr(subj(*))) = pl,
  102.           comp(*) = none,
  103.           tensed(*) = +,
  104.           inv(*) = -.
  105.  
  106. chase  V: pred(sem(*)) = chase,
  107.           agent(sem(*)) = sem(subj(*)),
  108.           patient(sem(*)) = sem(obj(*)),
  109.           comp(*) = none,
  110.           tensed(*) = -,
  111.           form(*) = bare,
  112.           inv(*) = -.
  113.  
  114. thinks V: pred(sem(*)) = think,
  115.           agent(sem(*)) = sem(subj(*)),
  116.           theme(sem(*)) = sem(comp(*)),
  117.           obj(*) = none,
  118.           num(agr(subj(*))) = sg,
  119.           tensed(*) = +,
  120.           tensed(comp(*)) = +,
  121.           inv(*) = -.
  122.  
  123. think  V: pred(sem(*)) = think,
  124.           agent(sem(*)) = sem(subj(*)),
  125.           theme(sem(*)) = sem(comp(*)),
  126.           obj(*) = none,
  127.           num(agr(subj(*))) = pl,
  128.           tensed(*) = +,
  129.           tensed(comp(*)) = +,
  130.           inv(*) = -.
  131.  
  132. think  V: pred(sem(*)) = think,
  133.           agent(sem(*)) = sem(subj(*)),
  134.           theme(sem(*)) = sem(comp(*)),
  135.           obj(*) = none,
  136.           tensed(*) = -,
  137.           form(*) = bare,
  138.           tensed(comp(*)) = +,
  139.           inv(*) = -.
  140.           
  141. wonders V: pred(sem(*)) = wonder,
  142.            agent(sem(*)) = sem(subj(*)),
  143.            theme(sem(*)) = sem(comp(*)),
  144.            obj(*) = none,
  145.            tensed(*) = +,
  146.            inv(*) = -,
  147.            num(agr(subj(*))) = sg,
  148.            tensed(comp(*)) = +,
  149.            wh(comp(*)) = +.
  150.           
  151. wonder  V: pred(sem(*)) = wonder,
  152.            agent(sem(*)) = sem(subj(*)),
  153.            theme(sem(*)) = sem(comp(*)),
  154.            obj(*) = none,
  155.            tensed(*) = +,
  156.            inv(*) = -,
  157.            num(agr(subj(*))) = pl,
  158.            tensed(comp(*)) = +,
  159.            wh(comp(*)) = +.
  160.           
  161. wonder  V: pred(sem(*)) = wonder,
  162.            agent(sem(*)) = sem(subj(*)),
  163.            theme(sem(*)) = sem(comp(*)),
  164.            obj(*) = none,
  165.            tensed(*) = -,
  166.            inv(*) = -,
  167.            form(*) = bare,
  168.            tensed(comp(*)) = +,
  169.            wh(comp(*)) = +.
  170.  
  171. seems  V: pred(sem(*)) = seem,
  172.           theme(sem(*)) = sem(comp(*)),
  173.           subj(*) = subj(comp(*)),
  174.           obj(*) = none,
  175.           num(agr(subj(*))) = sg,
  176.           tensed(*) = +,
  177.           inv(*) = -,
  178.           tensed(comp(*)) = -,
  179.           form(comp(*)) = inf.
  180.  
  181. seems  V: pred(sem(*)) = seem,
  182.           theme(sem(*)) = sem(comp(*)),
  183.           sem(subj(*)) = it,
  184.           obj(*) = none,
  185.           tensed(*) = +,
  186.           inv(*) = -,
  187.           tensed(comp(*)) = +.
  188.  
  189. seem   V: pred(sem(*)) = seem,
  190.           theme(sem(*)) = sem(comp(*)),
  191.           subj(*) = subj(comp(*)),
  192.           obj(*) = none,
  193.           num(agr(subj(*))) = pl,
  194.           tensed(*) = +,
  195.           inv(*) = -,
  196.           tensed(comp(*)) = -,
  197.           form(comp(*)) = inf.
  198.  
  199. seem   V: pred(sem(*)) = seem,
  200.           theme(sem(*)) = sem(comp(*)),
  201.           subj(*) = subj(comp(*)),
  202.           obj(*) = none,
  203.           tensed(*) = -,
  204.           inv(*) = -,
  205.           form(*) = bare,
  206.           tensed(comp(*)) = -,
  207.           form(comp(*)) = inf.
  208.  
  209. to     V: sem(*) = sem(comp(*)),
  210.           subj(*) = subj(comp(*)),
  211.           obj(*) = none,
  212.           tensed(*) = -,
  213.           inv(*) = -,
  214.           form(*) = inf,
  215.           tensed(comp(*)) = -,
  216.           form(comp(*)) = bare.
  217.  
  218. does   V: emphatic(sem(*)) = +,
  219.           sem(*) = sem(comp(*)),
  220.           subj(*) = subj(comp(*)),
  221.           obj(*) = none,
  222.           num(agr(subj(*))) = sg,
  223.           tensed(*) = +,
  224.           tensed(comp(*)) = -,
  225.           form(comp(*)) = bare.
  226.  
  227. do     V: emphatic(sem(*)) = +,
  228.           sem(*) = sem(comp(*)),
  229.           subj(*) = subj(comp(*)),
  230.           obj(*) = none,
  231.           num(agr(subj(*))) = pl,
  232.           tensed(*) = +,
  233.           tensed(comp(*)) = -,
  234.           form(comp(*)) = bare.
  235.  
  236. will   V: pred(sem(*)) = future,
  237.           theme(sem(*)) = sem(comp(*)),
  238.           subj(*) = subj(comp(*)),
  239.           obj(*) = none,
  240.           tensed(*) = +,
  241.           tensed(comp(*)) = -,
  242.           form(comp(*)) = bare.
  243.           
  244. ;;; rules
  245.  
  246. S1 --> S:  *0 = *1,            ; expands an S1 to a complementizerless S
  247.            wh(*0) = -.
  248.  
  249. S1 --> C S: *0 = *1,           ; expands an S1 to a that-complementizer and an S
  250.             *0 = *2, 
  251.             wh(*0) = -.
  252.  
  253. S1 --> C S: *0 = *1,           ; expands an S1 to a WH-operator complementizer and an S
  254.             scope(*1) = *2,
  255.             binds(*1) = slash(*2),
  256.             tensed(*0) = tensed(*2),
  257.             form(*0) = form(*2),
  258.             inv(*2) = root(*0).
  259.  
  260. S --> VP:   form(*0) = form(*1),   ; the "VP-metarule"
  261.             tensed(*0) = tensed(*1),
  262.             root(*0) = root(*1),
  263.             sem(*1) = sem(*0),
  264.             slash(*0) = subj(*1),
  265.             slash(*1) = none.
  266.  
  267. S --> NP VP: *0 = *2,
  268.              inv(*0) = -,
  269.              subj(*0) = *1,
  270.              slash(*1) = none.
  271.  
  272. S --> V NP VP: *0 = *1,
  273.                comp(*0) = *3,
  274.                inv(*0) = +,
  275.                root(*0) = +,
  276.                question(sem(*0)) = +,
  277.                subj(*0) = *2,
  278.                slash(*0) = slash(*3),
  279.                slash(*2) = none.
  280.  
  281. VP --> V: *0 = *1,
  282.           obj(*0) = none,
  283.           comp(*0) = none,
  284.           slash(*0) = none.
  285.  
  286. VP --> V NP: *0 = *1,
  287.              obj(*0) = *2,
  288.              comp(*0) = none,
  289.              slash(*0) = slash(*2).
  290.  
  291. VP --> V S1: *0 = *1,
  292.              obj(*0) = none,
  293.              comp(*0) = *2,
  294.              inv(*2) = -,
  295.              root(*2) = -,
  296.              tensed(*2) = +,
  297.              slash(*0) = slash(*2).
  298.  
  299. VP --> V VP: *0 = *1,
  300.              obj(*0) = none,
  301.              comp(*0) = *2,
  302.              tensed(*2) = -,
  303.              slash(*0) = slash(*2).
  304.  
  305. NP --> Det N: *0 = *1,
  306.               *0 = *2,
  307.               slash(*0) = none.
  308.  
  309. NP --> N: *0 = *1,
  310.           def(sem(*1)) = -,
  311.           num(agr(*1)) = pl,
  312.           slash(*0) = none.
  313.  
  314. NP --> : *0 = slash(*0).       ; the slash termination rule
  315.  
  316. #]